package com.example.service.util.conversion;

import com.example.common.util.constant.OrderConstants;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author juzipi
 * @Date 2021/7/25 17:40
 * @Info orderInfo 状态数字转字符串
 */
public class OrderInfoConversion {


    public static final String UNPAID = "已预约，未支付";//已预约，未支付

    public static final String PAID = "已支付";//已支付

    public static final String TAKE_NUMBER = "已取号";//已取号

    public static final String CANCEL_RESERVE = "取消预约";//取消预约


    public static String stateTransition(Integer status){
        String statusString = "";
        switch (status){
            case 0:
                statusString = UNPAID;
                break;
            case 1:
                statusString = PAID;
                break;
            case 2:
                statusString = TAKE_NUMBER;
                break;
            case -1:
                statusString = CANCEL_RESERVE;
            default:
                break;
        }
        return statusString;
    }



//    public static List<Map<String,Object>> getStatusList() {
//        List<Map<String,Object>> list = new ArrayList<>();
//
//        ArrayList<Object> objects = new ArrayList<>();
//        objects.add(0,0);
//        objects.add(1,1);
//        objects.add(2,2);
//        objects.add(3,-1);
//        ArrayList<String> strings = new ArrayList<>();
//        strings.add(0,UNPAID);
//        strings.add(1,PAID);
//        strings.add(2,TAKE_NUMBER);
//        strings.add(3,CANCEL_RESERVE);
//        for (int i = 0; i < 4; i++) {
//            HashMap<String, Object> hashMap = new HashMap<>();
//            hashMap.put(OrderConstants.STATUS,strings.get(i));
//            hashMap.put(OrderConstants.COMMENT,objects.get(i));
//            list.add(i,hashMap);
//        }
//
//        return list;
//    }
}
